#compiler gcc
CC=gcc
#show warnings + optimization level 3
CFLAGS= -g -Wall -O3
#add library for math, needed in assignment 3
LIBS=-lm
CSOURCES= hash.c netlist.c


OBJ=$(CSOURCES:.c=.o)

#compile application and run it.
app: $(OBJ)
	$(CC)  -o $@ $^ $(CFLAGS) $(LIBS)
	@-./app

%.o: %.c $(CSOURCES) 
	$(CC) -c -o $@ $< $(CFLAGS)

#clean objects, backup files and application file
clean:
	rm -f *.o *~ app